export default{
    state:{
        shoplist:[]//存储收藏的店铺
    },
    mutations:{
        fav(state, params){ //收藏店铺
            if( params ){
              state.shoplist.push( params );
            }
          },
          unfav(state, params ){ //取消收藏店铺
            //查找店铺
            var index = state.shoplist.findIndex((item)=>{
              return item.mtWmPoiId == params.mtWmPoiId;
            })
            //从收藏的店铺列表中 将该店铺删除
            if( index != -1 ){
              state.shoplist.splice(index,1);
            }
          }
    }
}